var app = new Vue({
    el: '#header',
    data() {
        return {
            msg: 'header1',
            headerList: [{
                    path: "index.html",
                    name: '网站首页'
                },
                {
                    path: "product.html",
                    name: '产品服务'
                },
                {
                    path: "collaborate.html",
                    name: '合作加盟'
                },
                {
                    path: "news.html",
                    name: '新闻资讯'
                },
                {
                    path: "positionlist.html",
                    name: '人才招聘'
                },
                {
                    path: "aboutus.html",
                    name: '关于我们'
                }
            ],
            headerList1: []
        }
    },
    created() {
        this.getHeaderList();
    },
    methods: {
        getHeaderList() {

            var storage = window.sessionStorage;

            var c = storage.getItem("headerList");

            if (!c) {
                axios.get('system/service/viewMenu/findAll')
                    .then(res => {
                        console.log(res.data.data)
                        this.headerList1 = res.data.data;
                        storage.setItem("headerList", JSON.stringify(this.headerList1));
                    })
                    .catch(err => {
                        console.error(err);
                    })
            } else {
                this.headerList1 = JSON.parse(c);
            }
        }
    }
})